﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DAL;
using Model;

namespace BLL
{
    public class TBUserBLL
    {
        TBUserDAL tBUser = new TBUserDAL();
        public bool insert(string name,string pass,int sex=0) {
            TBUserDAL tB = new TBUserDAL();
            TBUser user = new TBUser()
            {
                Name = name,
                Password = pass,
                Sex = sex,
                CreationTime = DateTime.Now
            };
            
            var a = tBUser.insert(user);
            return a;
        }


        public TBUser tiao(string name, string pass) {
            return tBUser.Tiao(a=>a.Name==name && a.Password==pass);
        }


        public TBUser tiaoId(string id)
        {
            return tBUser.Tiao(a => a.Id==id);
        }
    }
}
